#include "fu_flash.h"
#include "ha_flash.h"


/**
  * @brief  read data using byte mode
  * @param  read_addr: the address of reading
  * @param  p_buffer: the buffer of reading data
  * @param  num_read: the number of reading data
  * @retval none
  */
void read_byte_internal_flash(uint32_t read_addr, uint8_t *p_buffer, uint16_t num_read)
{
	at32_flash_read_byte(read_addr,p_buffer,num_read);
}

/**
  * @brief  read data using halfword mode
  * @param  read_addr: the address of reading
  * @param  p_buffer: the buffer of reading data
  * @param  num_read: the number of reading data
  * @retval none
  */
void read_halfword_internal_flash(uint32_t read_addr, uint16_t *p_buffer, uint16_t num_read)
{
	at32_flash_read_halfword(read_addr,p_buffer,num_read);
}

/**
  * @brief  read data using word mode
  * @param  read_addr: the address of reading
  * @param  p_buffer: the buffer of reading data
  * @param  num_read: the number of reading data
  * @retval none
  */
void read_word_internal_flash(uint32_t read_addr, uint32_t *p_buffer, uint16_t num_read)
{
	at32_flash_read_word(read_addr,p_buffer,num_read);
}

/**
  * @brief  write data using byte mode with checking
  * @param  write_addr: the address of writing
  * @param  p_buffer: the buffer of writing data
  * @param  num_write: the number of writing data
  * @retval result
  */
error_status write_byte_internal_flash(uint32_t write_addr,uint8_t *p_buffer,uint16_t num_write)
{
	return at32_flash_write_byte(write_addr,p_buffer,num_write);
}

/**
  * @brief  write data using halfword mode with checking
  * @param  write_addr: the address of writing
  * @param  p_buffer: the buffer of writing data
  * @param  num_write: the number of writing data
  * @retval result
  */
error_status write_halfword_internal_flash(uint32_t write_addr,uint16_t *p_buffer,uint16_t num_write)
{
	return at32_flash_write_halfword(write_addr,p_buffer,num_write);
}

/**
  * @brief  write data using word mode with checking
  * @param  write_addr: the address of writing
  * @param  p_buffer: the buffer of writing data
  * @param  num_write: the number of writing data
  * @retval result
  */
error_status write_word_internal_flash(uint32_t write_addr,uint32_t *p_buffer,uint16_t num_write)
{
	return at32_flash_write_word(write_addr,p_buffer,num_write);
}









